<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<head>
	<meta name="decorator" content="default"/>
	<style>
		.ul-form label{width: 50px !important;}
		.ul-form .input-medium{width: 140px !important;}
	</style>
</head>
<div style="padding: 10px 10px;">
	<form:form id="searchForm" modelAttribute="user" action="${ctx}/sys/member/member/load/userList" method="post" class="breadcrumb form-search ">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<div style="height: 30px;">
			<ul class="ul-form">
				<li><label>姓名：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/></li>
				<li><label>手机：</label><form:input path="mobile" htmlEscape="false" maxlength="50" class="input-medium"/></li>
				<li class="btns"><button  id="query" class="btn btn-primary" > 查询</button>
			</ul>
		</div>
	</form:form>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th class="sort-column name">姓名</th><th>手机</th><th>归属部门</th><th >操作</tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="user">
			<tr>
				<td>${user.name}</td>
				<td>${user.mobile}</td>
				<td>${user.office.name}</td>
				<td><button class="btn btn-primary add" data-id="${user.id}" data-office="${user.office.name}" data-name="${user.name}">选择</button></th></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</div>

<div class="pagination">${page}</div>
<script  type="text/javascript">
	function page(n,s){
		if(n) $("#pageNo").val(n);
		if(s) $("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
	$(function () {
		$(".add").click(function () {
			var managerId=$(this).data("id");
			var managerName=$(this).data("name");
			$('#managerId').val(managerId);
			$('#managerName').val(managerName);
			$('#managerId', window.parent.document).val(managerId);
			$('#managerName', window.parent.document).val(managerName);
			if(window.parent.managerIndex){
				window.parent.layer.close(window.parent.managerIndex);
			}else{
				window.parent.layer.closeAll();
			}

		});
	});

</script>